<template>
  <el-form
    ref="ruleFormRef"
    :model="newFormInline"
    :rules="formRules"
    label-width="120px"
    class="w-full"
  >
    <el-form-item label="分组名称" prop="name">
      <el-input v-model="newFormInline.name" placeholder="请输入分组名称" />
    </el-form-item>
  </el-form>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { FormProps } from "../componentsUtils/type/deviceGroupTypes";
import { formRules } from "../componentsUtils/rule/deviceGroupRules";
import { ElMessage } from "element-plus";

const props = withDefaults(defineProps<FormProps>(), {
  formInline: () => ({
    id: "",
    tenantId: 0,
    name: "",
    dealerId: 0
  }),
  title: "",
  lesseeOptions: () => []
});

const newFormInline = ref(props.formInline);
const ruleFormRef = ref();

function getRef() {
  return ruleFormRef.value;
}

defineExpose({ getRef });
</script>
